//
//  MessageModel.m
//  EnterpriseCloud
//
//  Created by 东亨 on 2017/8/7.
//  Copyright © 2017年 lichao. All rights reserved.
//

#import "MessageModel.h"

@implementation FileListModel

@end

@implementation MessageModel
- (id)initWithType:(NSInteger)type dictionary:(NSDictionary *)dic
{
    self = [super init];
    if(self)
    {
        self.fileList = [[NSMutableArray alloc]initWithCapacity:0];
        if (type == 0)
        {
            self.message_content = dic[@"message_content"];
            self.message_time = dic[@"message_time"];
        }
        else
        {
            self.message_content = dic[@"repair_content"];
            self.message_time = dic[@"repair_time"];
 
        }
        NSArray *files = [NSArray arrayWithArray:dic[@"fileList"]];
        for (NSDictionary *dic in files)
        {
            FileListModel *model = [[FileListModel alloc]init];
            model.file_type = dic[@"file_type"];
            model.file_path = dic[@"file_path"];
            model.file_name = dic[@"file_name"];
            [self.fileList addObject:model];
        }
    }
    return self;
}
@end

